home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13928 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: nntp.teleport.com!usenet
  2. From: GHouck <hksys@teleport.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Reverting of big array ?
  5. Date: 28 Mar 1996 01:02:07 GMT
  6. Organization: systems hk
  7. Message-ID: <4jcoef$8bm@nadine.teleport.com>
  8. References: <31587ACF.59D9@teleport.com> <4jbock$s7j@erinews.ericsson.se>
  9. NNTP-Posting-Host: ip-pdx09-41.teleport.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. etmbgom@ericsson.se (Ben van Gompel) wrote:
  16. >In article <31587ACF.59D9@teleport.com>, GHouck <hksys@teleport.com> writes:
  17. >> Thomas,
  18. >> It might not be much faster, but I usually use the following:
  19. >> 
  20. >>   for( i=0; i<numChars/2; i++ )
  21. >>     strChars[i] = strChars[numChars-i-1];
  22. >
  23. >That won't work.
  24. >You better use something like:
  25. >
  26. >  char* newChars = new char[numChars+1]
  27. >  for( i=0; i<numChars; i++ )
  28. >  {
  29. >     newChars[i] = oldChars[numChars-i-1];
  30. >  }
  31. >  newChars[numChars] = '\0';
  32. >
  33. >But still, this won't be fast enough I'd guess.
  34. >
  35. >Regards, Ben
  36. Ben,
  37. Just out of curiousity, why won't it work?
  38. Yours, Geoff Houck
  39.  
  40.  
  41.